package com.eskie.packageid;

import android.app.Activity;
import android.os.Bundle;
import android.provider.Settings.Secure;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class Display extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_display);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.display, menu);
		return true;
	}
	
	public void GeneratePackageID(View view){
        
		TextView txtPackageID = (TextView) findViewById(R.id.txtPackageID);
		txtPackageID.setText("ID: " + PackageID());
	}	
	
	private String PackageID(){
		String tmpStr = null;
		String serialnum = Secure.getString(getBaseContext().getContentResolver(),
                Secure.ANDROID_ID); 
		tmpStr = serialnum;
		
		
		Toast.makeText(this, tmpStr, Toast.LENGTH_SHORT).show();
		return tmpStr;
	}

}
